import {createRouter, createWebHashHistory} from 'vue-router'

const router = createRouter({
    history: createWebHashHistory(),
    routes: [
        {
            path: '/',
            component: () => import('../views/web/index.vue'),
            children: [
                {
                    path: '',
                    component: () => import('../views/web/Home.vue')
                },
                {
                    path: 'sign',
                    component: () => import('../views/web/Sign.vue')
                },
                {
                    path: 'login',
                    component: () => import('../views/web/Login.vue')
                },
                {
                    path: 'password',
                    component: () => import('../views/web/ChangePassword.vue')
                },
                {
                    path: 'user',
                    component: () => import('../views/web/User.vue')
                },
                {
                    path: 'rooms',
                    component: () => import('../views/web/Rooms.vue')
                },
                {
                    path: 'room-detail/:id',
                    component: () => import('../views/web/RoomDetail.vue')
                },
            ]
        },
        {
            path: '/admin-login',
            component: () => import('../views/admin/LoginAdmin.vue'),
            children: []
        },
        {
            path: '/admin',
            component: () => import('../views/admin/Admin.vue'),
            children: [
                {
                    path: '',
                    component: () => import('../views/admin/room/Index.vue')
                },
                {
                    path: 'order',
                    component: () => import('../views/admin/order/Index.vue')
                },
                {
                    path: 'config',
                    component: () => import('../views/admin/Config.vue')
                },
                {
                    path: 'type',
                    component: () => import('../views/admin/type/Index.vue')
                },
                {
                    path: 'user',
                    component: () => import('../views/admin/User.vue')
                },
                {
                    path: 'password',
                    component: () => import('../views/admin/password.vue')
                }
            ]
        }
    ]
})

export default router
